  	<div class="secMenu-headBar">
  		<div class="secMenu-left">伯坦换电站计费系统</div>
  		<div class="secMenu-right right">
	  		<div class="secMenu-headUser"><i class="fa fa-user"></i><#if user??>${user.getUsername()}</#if></div>
	  		<div class="secMenu-headExit"><a class="a-white" href="<@spring.url '/do_logout'></@spring.url>">退出</a></div>
  		</div>
  	</div>
 
<script type="text/javascript">
    function changePW(){
        showChangePassword();
    }
    function doChangePassword() {
        var changePW0=document.getElementById("changePW0").value;
        var changePW1=document.getElementById("changePW1").value;
        var count = true;
        if (changePW0 == null || changePW0 == "") {
            document.getElementById("changePW0").style.borderColor = "#FF0000";
            count=false;
        }

        if (changePW1 == null || changePW1 == "") {
            document.getElementById("changePW1").style.borderColor = "#FF0000";
            count=false;
        }
        //核对两次密码是否一致
        if(changePW0 != changePW1 && changePW0!=null &&changePW0!=""&&
                changePW1!=null &&changePW1!=""){
            document.getElementById("changePW0").style.borderColor = "#FF0000";
            document.getElementById("changePW1").style.borderColor = "#FF0000";
            count=false;
            alert("两次密码输入不一致！");
        }else{
            var z = /^[0-9a-zA-Z]+$/;
            if(z.test(changePW0) && changePW0.length>=4){
            }else{
                document.getElementById("changePW0").style.borderColor = "#FF0000";
                document.getElementById("changePW1").style.borderColor = "#FF0000";
                count=false;
                alert("密码必须是不小于4个字符的字母和数字");
            }
        }
        if (count) {
            // $("#changePWForm").submit();
            tojava(changePW0);
            hideChangePasswordPopup();
        }
    }
    var tojava = function(changePW0){
        $.getJSON(
                "changepw?pwd="+changePW0,
                function (data) {
                    alert(data);
                });
    }
    function showChangePassword() {//弹出层
        var newheadbackDiv = document.getElementById("newheadbackDiv");
        newheadbackDiv.style.top = "0%";//设置弹出层距离上边界的距离
        newheadbackDiv.style.left = "0%";//设置弹出层距离左边界的距离
        newheadbackDiv.style.width = "100%";//设置弹出层的宽度
        newheadbackDiv.style.height = "100%";//设置弹出层的高度
        newheadbackDiv.style.visibility = "visible";

        var changePWDiv = document.getElementById("changePWDiv");
        changePWDiv.style.top = "30%";//设置弹出层距离上边界的距离
        changePWDiv.style.left = "30%";//设置弹出层距离左边界的距离
        changePWDiv.style.width = "40%";//设置弹出层的宽度
        changePWDiv.style.height = "auto";//设置弹出层的高度
        changePWDiv.style.visibility = "visible";
    }

    function hideChangePasswordPopup() {//关闭层
        $("#changePW0").val(null);
        $("#changePW1").val(null);
        var newheadbackDiv = document.getElementById("newheadbackDiv");
        newheadbackDiv.style.visibility = "hidden";

        var changePWDiv = document.getElementById("changePWDiv");
        changePWDiv.style.visibility = "hidden";
    }
</script>

<div id="newheadbackDiv" onclick="hideChangePasswordPopup()" style="position: absolute;visibility: hidden;position:fixed;overflow: hidden;solid: #000000;background-color: #000000;padding: 1px;z-index: 99;filter:alpha(opacity=50);opacity: 0.5;"></div>
<div id="changePWDiv" class="row-fluid" style="position: absolute;visibility: hidden;overflow: hidden;padding: 1px;z-index: 100;background-color: #FFFFFF;">
    <div class="span12">
        <div class="portlet box green" style="padding: 0px;margin:0px;">
            <div class="portlet-title">
                <div class="caption"><i class="icon-edit"></i>修改密码</div>
            </div>
            <div class="portlet-body flip-scroll">
                <form id="changePWForm" action="<@spring.url '/change_user_pw'></@spring.url>" method="POST">
                    <table class="table-bordered table-striped table-condensed flip-content">
                        <tbody role="alert" aria-live="polite" aria-relevant="all">
                        <#--RongBegin-->
                        <tr class="even">
                            <td style="text-align: right;">请输入密码</td>
                            <td class="center">
                                <input class="m-wrap span8" style="margin-top: 10px" type="password" id="changePW0" name="changePW0" value="" placeholder="请输入密码"/>
                            </td>
                        </tr>
                        <tr class="even">
                            <td style="text-align: right;">请再次输入密码</td>
                            <td class="center">
                                <input class="m-wrap span8" style="margin-top: 10px" type="password" id="changePW1" name="changePW1" value="" placeholder="请再次输入密码"/>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    </br>
                    <div class="controls controls-row" style="text-align: right;">
                        <input type="button" value="确认" class="btn green" onclick="doChangePassword()"/>
                    <#--<input type="reset" value="重置" class="btn green" onclick="resetLabel()"/>-->
                        <input type="button" value="取消" class="btn green" onclick="hideChangePasswordPopup()" />
                    </div>
                    <input  type="hidden" id="userId" name="userId" />

                </form>
            </div>
        </div>
    </div>
</div>